package cn.edu.scau.service;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.multipart.MultipartFile;

import cn.edu.scau.entity.Blog;
import cn.edu.scau.entity.User;

public interface UserService extends BaseService<User> {
	
	Integer registerTheUser(User user);
	
	Integer loginTheUser(String picCode,String checkCode,HttpServletRequest req,HttpServletResponse resp)throws UnsupportedEncodingException;
	
	boolean updateTheUserMessage(Integer userId,User updateUser,HttpServletResponse resp)throws UnsupportedEncodingException;
	
	Integer changeTheUserHeadPicture(Integer userId,MultipartFile[] files, HttpServletRequest req,HttpServletResponse resp)throws Throwable,IOException;
	
	Integer checkBeActive(Integer userId);
	
	boolean checkEmail(String userEmail);
	
	void sendEmail(Integer userId);
	
	String MD5(String password);
	
	void picCode(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse)throws IOException;
	
	boolean checkPicCode(String picCode,String checkCode);
	
	User findUser(Integer userId);
	
	List<Blog> findUserBlogByType(Integer userId,Integer pageNo,Integer type);
	
	long getBlogsMaxPageByType(Integer userId,Integer type);
	
	void addUserBlog(Integer userId,Blog blog);
	
	boolean addUserColBlog(Integer userId,Integer blogId);
	
	boolean deleteBlogByType(Integer userId,Integer blogId,Integer type);
}	
